package com.maptest;

import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.os.Bundle;

public class AndroidGoogleMapsProjectActivity extends MapActivity {
    /** Called when the activity is first created. */
	
	MapView mapView; 
    MapController mc;  
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	 OverlayItem [] foodItem = {
    	            new OverlayItem( new GeoPoint(35952967,-83929158), "Food Title 1", "Food snippet 1"), 
    	            new OverlayItem( new GeoPoint(35953000,-83928000), "Food Title 2", "Food snippet 2"),
    	            new OverlayItem( new GeoPoint(35955000,-83929158), "Food Title 3", "Food snippet 3") 
    	 };
    	        

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mapView = (MapView) findViewById(R.id.mapView);
        mapView.setBuiltInZoomControls(true);
        mapView.setSatellite(true);
        MapController mapController = mapView.getController();
        mapController.setZoom(17);
        List<Overlay> mapOverlays = mapView.getOverlays();
        Drawable drawable = this.getResources().getDrawable(R.drawable.marker);
        CustomizedOverlay itemizedOverlay = new CustomizedOverlay(drawable, this);
        
     // Display all three items at once
        for(int i=0; i<foodItem.length; i++){
        	System.out.println("Executing loop:"+i);
            
        	itemizedOverlay.addOverlay(foodItem[i]);           
        }
        mapOverlays.add(itemizedOverlay);
        mapView.postInvalidate();
       
    }

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
}